﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Pointandclick.ScreenManagement
{
    class TextMenuButton : MenuElement
    {

        /// <summary>
        /// A button that takes you to other screens when clicked on
        /// </summary>
        /// <param name="label">Label displayed onscreen</param>
        /// <param name="font">Font used to write its label</param>
        /// <param name="position">Position it will be drawn</param>
        public TextMenuButton(string label, SpriteFont font)
            : base(label, font)
        { 
            Rectangle = new Rectangle(0, 0, (int)font.MeasureString(label).X, (int)font.MeasureString(label).Y);
        }

        public string Update()
        {
            if (this.ClickedOn())
                return Label;
            return "";
        }


        /// <summary>
        /// Draws the elements label onscreen
        /// </summary>
        /// <param name="spriteBatch"></param>
        public override void Draw(SpriteBatch spriteBatch, Vector2 Pos, Color color)
        {
            spriteBatch.DrawString(Font, Label, Pos, color);
        }

    }
}
